home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / ifp1s157.zip / PAGE_11.PAS < prev    next >
Pascal/Delphi Source File  |  1993-06-26  |  1KB  |  61 lines

  1. unit page_11;
  2.  
  3. interface
  4.  
  5. uses crt, dos, ifpglobl, ifpcomon;
  6.  
  7. procedure page11;
  8.  
  9. implementation
  10.  
  11. procedure page11;
  12.   var
  13.     temp, temp1, envseg, envlen, envused: word;
  14.     foundit, endfound: boolean;
  15.  
  16.   begin
  17.   caption2('Program name');
  18.   Writeln(ParamStr(0));
  19. {PC Magazine, Vol 8, no. 20 (11/28/89), pg 309, from Barry Simon}
  20.   temp:=MemW[PrefixSeg:$16];
  21.   foundit:=false;
  22.   while not foundit do
  23.     begin
  24.     temp1:=MemW[temp:$16];
  25.     if (temp1 = 0) or (temp1 = temp) then
  26.       foundit:=true
  27.     else
  28.       temp:=temp1
  29.     end;
  30.   envseg:=MemW[temp:$2C];
  31.   if (envseg = 0) or ((osminor > 19) and (osminor < 30)) then
  32.     envseg:=temp + MemW[temp-1:3] + 1;
  33.   envlen:=MemW[envseg - 1:3] * 16;
  34.   envused:=0;
  35.   endfound:=false;
  36.   while not endfound do
  37.     if MemW[envseg:envused] = 0 then
  38.       endfound:=true
  39.     else
  40.       Inc(envused);
  41.   Inc(envused, 2);
  42.   caption2('Environment');
  43.   Writeln;
  44.   caption3('Segment');
  45.   Write(hex(envseg, 4));
  46.   caption3('Size');
  47.   Write(envlen:4);
  48.   caption3('Used');
  49.   Write(envused:4);
  50.   caption3('Free');
  51.   Writeln((envlen - envused):4);
  52.   caption2('Variables');
  53.   window(3, 7, twidth, tlength - 2);
  54.   for i:=1 to envcount do begin
  55.     pause2;
  56.     if endit then
  57.       Exit;
  58.     writeln(envstr(i))
  59.   end
  60.   end;
  61. end.